package com.ford.microservices.accounts;

import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.Collection;
import java.util.List;

public interface AccountRepository extends CrudRepository<Account, Long> {
    Account findByCellPhone(String cellPhone);

    @Query("SELECT u FROM Account u WHERE u.role = 'SALES' ORDER BY balance DESC")
    List<Account> findAllSalesAccount();
}
